﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetworkPower.Data.Models.Mapping
{
    public class DepartmentMap : EntityTypeConfiguration<Department>
    {
        public DepartmentMap()
        {
            // Primary Key
            this.HasKey(t => new { t.DepartmentId });

            // Properties
            this.Property(t => t.DepartmentName)
               .IsRequired();

            // Table & Column Mappings
            this.ToTable("Departments");
            this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
            this.Property(t => t.DepartmentName).HasColumnName("DepartmentName");
        }
    }
}
